package com.hc.bean;

import lombok.Data;

import java.io.Serializable;

@Data
public class OrderDetail implements Serializable {
    private Integer id;
    private Integer oid;
    private Integer pid;
    private Integer num;

    private ProductInfo productInfo;
    private Double price;
    private Double totalprice;

    public Double getPrice() {
        if(productInfo!=null){
            return productInfo.getPrice();
        }
        return 0D;
    }

    public Double getTotalprice() {
        return this.getPrice()*num;
    }
}
